package com.designpatterns.cor.concretehandler;

import com.designpatterns.cor.handler.RequestHandle;
import com.designpatterns.cor.request.Request;
import com.designpatterns.cor.request.impl.LeaveRequest;

/**
 * TLRequestHandle Class Implements RequestHandle Interface
 * @see RequestHandle
 *
 * @author Haiqi.Wang
 * @since 2013-6-9下午12:43:47
 */
public class TLRequestHandle implements RequestHandle {
	
	RequestHandle rh;
	
	/**
	 * Arguments Constructor
	 * @param rh {@link RequestHandle}
	 */
	public TLRequestHandle(RequestHandle rh) {
		this.rh = rh;
	}

	@Override
	public void handleRequest(Request request) {
		if (request instanceof LeaveRequest) {
			System.out.println("要请假，项目组长审批！");
		}else {
			rh.handleRequest(request);
		}
	}

}
